#!/bin/sh

cd /usr/local/nginx/html

rm -rf *

git clone https://gitee.com/tolryg0/woniuticket-portal.git

rm -f /usr/local/nginx/conf/nginx.conf

cp /usr/local/nginx/html/woniuticket-portal/nginx/nginx.conf /usr/local/nginx/conf

cp -r ./woniuticket-portal/* /usr/local/nginx/html

rm -rf ./woniuticket-portal

if [ ! -f"/usr/local/nginx/logs/nginx.pid" ];then
  echo "启动nginx"
  /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
else
  echo "重启nginx"
  /usr/local/nginx/sbin/nginx -s stop
  /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
fi